<?php
require_once "config.php";
require_once "functions.php";
if(isset($_REQUEST['proId'])) {
	$productId=$_REQUEST['proId'];
	$sNo=$_REQUEST['sno'];
	$imageExpand="<a href='javascript:void(0);' onClick='funExpandProduct($productId,\"mchnt\",\"divSellingPro$productId\",$sNo)'><img src='images/16x16x+.jpg'  border='0'></a>";
	$products=getProductById($productId);		
	if(!empty($products['shipping']))
		$productShipping=" + ".$products['shipping'];
	else
		$productShipping=" + Free";
	$sqlSelSellingNoBargain="SELECT * FROM tbl_items where product_id='$productId'";
	$rstSelSellingNoBargain=mysql_query($sqlSelSellingNoBargain);				
	$numSelSellingNoBargain=mysql_num_rows($rstSelSellingNoBargain);
	if($numSelSellingNoBargain>0)
	{
	 $rowSelSellingNoBargain=mysql_fetch_array($rstSelSellingNoBargain);
	 $$flagexpander=1;		
	 echo "<table width=100% border='0' align='center' cellspacing='0'>
	       <tr>
	       <td width='5%'$imageExpand</td>	
		   <td width='3%' height='28'>$sNo</td>					         
	       <td width='15%' ><a href='index.php?SellProduct=$productId' title='$productTitle'> ".wordFormater($products['product_name'],10)."</a></td>
		   <td width='10%' >".$products['pro_condition']."</td>
		   <td width='9%' align='center'><a href='javascript:void(0);' onClick='window.location=index.php?editSellingProduct=$productId'>$numSelSellingNoBargain</a></td>
		   <td width='7%' >".$products['selling_type']."</td>
		   <td width='6%' align='center'>".$products['quantity']."</td>
		   <td width='11%' align='right'>".$rowSelSellingNoBargain['commission']."</td>
		   <td width='15%' align='right'>".$products['product_price']." $productShipping</td>
		   <td width='19%' ><a href='index.php?editlist=$productId'>Edit</a> | <a href='javascript:void(0);' onClick='funDelProduct($productId)'>Delete</a></td>
		   </tr>
		   </table>
		    ";	
		  }
    
  }
?>